package scuts.core.extensions;
import scuts.core.types.Future;
import scuts.core.types.ProgressiveFuture;

/**
 * ...
 * @author 
 */

class ProgressiveFutures 
{

  public static function toFuture(p:ProgressiveFuture) :Future
  {
    var fut = new Future();
    p.deliverTo(function (v) fut.deliver(v));
    p.ifCanceled(function () fut.cancel());
    return fut;
  }
  
}